范围::排序不编译 | 您所在的位置:网站首页 › cpp vector排序 › 范围::排序不编译 |
ranges::sort默认使用ranges::less来比较MyRect,这是在[range.cmp]中定义的。 结构范围::较少{ template constexpr bool运算符()(T& T,U& u) const;使用is_transparent =未指定;};template constexpr bool算子(T& t,U& u)构造; 约束:T和U满足totally_ordered_with。 它的operator()要求T和U必须满足total_ordered_with template concept totally_ordered_with = totally_ordered && totally_ordered && ...这要求T必须满足totally_ordered template concept totally_ordered = equality_comparable && partially-ordered-with;这要求T必须满足partially-ordered-with template concept partially-ordered-with = // exposition only requires(const remove_reference_t& t, const remove_reference_t& u) { { t < u } -> boolean-testable; { t > u } -> boolean-testable; { t boolean-testable; { t >= u } -> boolean-testable; { u < t } -> boolean-testable; { u > t } -> boolean-testable; { u boolean-testable; { u >= t } -> boolean-testable; };这就要求完整的关系运算符必须是格式良好的。 由于您没有为operator>、operator |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |